@import '../../style/_variables.less';
@import '../../style/hairline.less';

.mooli-cell {
  position: relative;
  display: flex;
  box-sizing: border-box;
  width: 100%;
  padding: @cell-vertical-padding @cell-horizontal-padding;
  overflow: hidden;
  color: @cell-text-color;
  font-size: @cell-font-size;
  line-height: @cell-line-height;
  background-color: @cell-background-color;
  content-visibility: auto;

  &::after {
    .hairline-bottom(@cell-border-color, @padding-md, @padding-md);
  }

  &:last-child::after,
  &--border::after {
    display: none;
  }

  &--label {
    margin-top: @cell-label-margin-top;
    color: @cell-label-color;
    font-size: @cell-label-font-size;
    line-height: @cell-label-line-height;
  }

  &--title,
  &--value {
    flex: 1;
  }

  &--value {
    position: relative;
    overflow: hidden;
    color: @cell-value-color;
    text-align: right;
    vertical-align: middle;
    word-wrap: break-word;

    &--alone {
      color: @text-color;
      text-align: left;
    }
  }

  &--left-icon.mooli-icon,
  &--right-icon.mooli-icon {
    height: @cell-line-height;
    font-size: @cell-icon-size;
    line-height: @cell-line-height;
  }

  &--left-icon {
    margin-right: @padding-base;
    height: @cell-line-height;
    font-size: @cell-icon-size;
    line-height: @cell-line-height;
  }

  &--right-icon {
    margin-left: @padding-base;
    color: @cell-right-icon-color;
  }

  &--clickable {
    cursor: pointer;

    &:active {
      background-color: @cell-active-color;
    }
  }

  &--required {
    overflow: visible;

    &::before {
      position: absolute;
      left: @padding-xs;
      color: @cell-required-color;
      font-size: @cell-font-size;
      content: '*';
    }
  }

  &--center {
    align-items: center;
  }

  &--large {
    padding-top: @cell-large-vertical-padding;
    padding-bottom: @cell-large-vertical-padding;

    .mooli-cell--title {
      font-size: @cell-large-title-font-size;
    }

    .mooli-cell--label {
      font-size: @cell-large-label-font-size;
    }
  }
}

.mooli-cell-group {
  background-color: @cell-group-background-color;

  &--title {
    padding: @cell-group-title-padding;
    color: @cell-group-title-color;
    font-size: @cell-group-title-font-size;
    line-height: @cell-group-title-line-height;
  }
}
